package com.weiyuwqj.server.service.asset.impl;

import com.github.pagehelper.PageHelper;
import com.weiyuwqj.api.common.PageList;
import com.weiyuwqj.api.common.Paginator;
import com.weiyuwqj.api.model.BusAssetRepay;
import com.weiyuwqj.api.model.vo.BusAssetPackageInvestVo;
import com.weiyuwqj.api.service.BusAssetRepayService;
import com.weiyuwqj.server.mapper.BusAssetRepayMapper;
import com.weiyuwqj.server.service.base.BaseServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by zhangyong on 2017/5/6.
 */
@Service("BusAssetRepayService")
public class BusAssetRepayServiceImpl extends BaseServiceImpl<BusAssetRepay> implements BusAssetRepayService{

    @Autowired
    private BusAssetRepayMapper assetRepayMapper;

    /**
     * 根据
     * @param packagePlanId
     * @param periods
     * @return
     */
    @Override
    public PageList listByPlanIdAndCurrentPeriod(Paginator p,Integer packagePlanId, Integer periods) {
        PageHelper.startPage(p.getPageNum(),p.getPageSize());
        List<BusAssetRepay> list = assetRepayMapper.listByPlanIdAndCurrentPeriod(packagePlanId, periods);
        return new PageList(list);
    }
}
